-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libzdb 1: the libening #15804
libzdb 1: the libening #15804
Conversation
Step 1 in trying to slowly rip the zdb functions out of zdb.c to allow people to play with more flexible things to leverage zdb's functionality. No promises on any functions or structs being stable, now or probably in general unless someone builds a more polished abstraction, the goal at the moment is to slowly untangle the global state usage in zdb... Signed-off-by: Rich Ercolani <[email protected]>
This is good. As a fairly regular zdb-customiser, I'm on board with the concept and your approach. I don't know if a stable libzdb API is possible or useful or desirable (I have many competing thoughts) but even if not, just a clear line between useful toolbox facilities and the frontend driver code would be a massive win. |
I'm on board with this. Breaking this monolith up in to a library with a useful API creates a lot of possibility for useful tools. |
Signed-off-by: Rich Ercolani <[email protected]>
I'm pretty sure the test failures now are unrelated. |
Signed-off-by: Rich Ercolani <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
All the test failures look unrelated now, so this should be good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good first step to me. Can you just rebase, squash, and comment on / address the makefile feedback.
Signed-off-by: Rich Ercolani <[email protected]>
Step 1 in trying to slowly rip the zdb functions out of zdb.c to allow people to play with more flexible things to leverage zdb's functionality. No promises on any functions or structs being stable, now or probably in general unless someone builds a more polished abstraction, the goal at the moment is to slowly untangle the global state usage in zdb... Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes openzfs#15804
Step 1 in trying to slowly rip the zdb functions out of zdb.c to allow people to play with more flexible things to leverage zdb's functionality. No promises on any functions or structs being stable, now or probably in general unless someone builds a more polished abstraction, the goal at the moment is to slowly untangle the global state usage in zdb... Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes openzfs#15804
Step 1 in trying to slowly rip the zdb functions out of zdb.c to allow people to play with more flexible things to leverage zdb's functionality. No promises on any functions or structs being stable, now or probably in general unless someone builds a more polished abstraction, the goal at the moment is to slowly untangle the global state usage in zdb... Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes openzfs#15804
Motivation and Context
Ultimately, I'd like to break out zdb's unique functionality into something more accessible for...not-zdb, because often you might want to script zdb, or make zdb do something bespoke, and a lot of global state in one huge binary makes these kinds of changes or use cases hard.
So I'd like to start cleaning that up by ripping the giant .c file into a library and then zdb.c becomes a much smaller consumer of that library's functionality.
This is a baby step of creating a mostly empty library and statically loading it in zdb. I've got a lot more progress than this, in another branch, but my goal was more to try and see how much pushback I'd get on this so that I'm not opening a huge PR with thousands of lines of diff in dozens of commits and trying to get feedback on all of it at once.
Description
Just creates a mostly-empty libzdb and libzdb.h, and moves a few functions and defines into it.
As I said in the commit, I wouldn't suggest making any promises anytime soon about this being a stable interface - the goal is to rapidly iterate to rip chunks out, so I wouldn't suggest anyone try consuming this until the rate of churn is substantially lower, other than, obviously, zdb itself, and it's statically loaded there so you don't have some .so incompatibility breaking zdb when you needed it most...
How Has This Been Tested?
It ran. I haven't noticed any failures, and when I ran tests locally, all the failures were not, as far I saw, in zdb-related things, and were inconsistent, so I think that's just the normal ZTS flakiness.
Types of changes
Checklist:
Signed-off-by
.